﻿using System;

namespace com.dtn.deals.Sercurity
{
    [Serializable]
    public class Ticket
    {
        private string clientName;
        public string ClientName
        {
            get { return this.clientName; }
            set { this.clientName = value; }
        }

        private string serviceName;
        public string ServiceName
        {
            get
            {
                return this.serviceName;
            }
            set { this.serviceName = value; }
        }

        private DateTime startTime;
        public DateTime StartTime
        {
            get { return this.startTime; }
            set { this.startTime = value; }
        }

        private DateTime endTime;
        public DateTime EndTime
        {
            get { return this.endTime; }
            set { this.endTime = value; }
        }

        private string sessionKey;
        public string SessionKey
        {
            get { return this.sessionKey; }
            set { this.sessionKey = value; }
        }

        public Ticket()
        {

        }
        public Ticket(string _clientName, string _serviceName, DateTime _startTime, DateTime _endTime, string _sessionKey)
        {
            this.clientName = _clientName;
            this.serviceName = _serviceName;
            this.startTime = _startTime;
            this.endTime = _endTime;
            this.sessionKey = _sessionKey;
        }
        public bool CheckValid()
        {
            return (this.StartTime < DateTime.Now && DateTime.Now < this.EndTime);

        }
    }
}
